﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Office.Interop.Word;

namespace WFL.Office.Word
{
    public class TableCells
    {

        public TableCell this[int index]
        {
            get { return new TableCell(_cells[index]) { Table = Table }; }
        }

        public int Count
        {
            get { return _cells.Count; }
        }

        public CellVerticalAlignment VerticalAlignment
        {
            get { return (CellVerticalAlignment)_cells.VerticalAlignment; }
            set { _cells.VerticalAlignment = (WdCellVerticalAlignment)value; }
        }

        private Cells _cells;

        public WordTable Table
        {
            get;
            internal set;
        }

        internal TableCells(Cells cells)
        {
            _cells = cells;
        }

        public void Merge()
        {
            _cells.Merge();
        }

        public void Split(int numRows,int numColumns,bool mergeBeforeSplit)
        {
            _cells.Split(numRows, numColumns, mergeBeforeSplit);
        }

    }
}
